<template>
  <view class="c-tabs-block">
    <view v-for="(item, index) in tabs" :key="item.value" class="tab-item" :class="{'active': tabIndex === index}" @click="tabClick(index)">
      {{ item.label }}
    </view>
  </view>
</template>
<script>
import './index.scss'
export default {
  name: 'Tabs',
  props: {
    tabs: {
      type: Array,
      default() { return [] }
    },
    tabIndex: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      currentIndex: 0
    }
  },
  methods: {
    tabClick(index) {
      this.$emit('tabClick', index)
    }
  }
}
</script>
